import MainView from "../modules/mainView.js";
import admins from "./admins/admins.js";
import schedules from "./schedules/schedules.js"

import Adimins1 from "./admins/admins1.js"


import cinemas from "./cinemas/cinemas.js";
import theaters from "./theaters/theaters.js";
import seats from "./seats/seats.js"
import seating from "./seating/seating.js"

import movies from "./movies/movies.js"

import user from "./users/user.js"


//配置路由规则
var routes = {
    ...admins,
    "/main":{
        ...user,
        ...schedules,
        ...Adimins1,
        ...cinemas,
        ...theaters,
        ...seats,
        ...seating,
        ...movies,
        //以及路由  优先执行
        on:(id)=>{
            new MainView("app",id)
        }
    }
}


//创建前端路由器
//配置路由的读取方式
var router = Router(routes).configure({ recurse: 'forward' });
//初始化路由器
router.init();
//初始化路由
window.location.hash = window.location.hash||"#/login"